from django import forms
from django.contrib.auth.forms import UserCreationForm
from .models import MyUser

class MyUserCreationForm(UserCreationForm):
    class Meta:
        model = MyUser
        fields = ('username', 'email', 'password1', 'password2', 'mobile', 'qq', 'weChat')
        labels = {
            'username': '用户名',
            'email': '邮箱',
            'password1': '密码',
            'password2': '确认密码',
            'mobile': '手机号码',
            'qq': 'QQ号码',
            'weChat': '微信账号',
        }
        widgets = {
            'username': forms.TextInput(attrs={'placeholder': '请输入用户名', 'class': 'form-control'}),
            'email': forms.EmailInput(attrs={'placeholder': '请输入邮箱', 'class': 'form-control'}),
            'password1': forms.PasswordInput(attrs={'placeholder': '请输入密码', 'class': 'form-control'}),
            'password2': forms.PasswordInput(attrs={'placeholder': '请确认密码', 'class': 'form-control'}),
            'mobile': forms.TextInput(attrs={'placeholder': '请输入手机号码', 'class': 'form-control'}),
            'qq': forms.TextInput(attrs={'placeholder': '请输入QQ号码', 'class': 'form-control'}),
            'weChat': forms.TextInput(attrs={'placeholder': '请输入微信账号', 'class': 'form-control'}),
        }
